package com.itcam.cm.manager.service.impl;

import com.itcam.cm.manager.mapper.SysUserRoleMapper;
import com.itcam.cm.manager.service.SysUserRoleService;
import com.itcam.cm.model.dto.system.AssginRoleDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysUserRoleServiceImpl implements SysUserRoleService {

    @Autowired
    private SysUserRoleMapper sysUserRoleMapper;

    @Override
    public void doAssign(AssginRoleDto assginRoleDto) {

        // 删除
        sysUserRoleMapper.deleteByUserId(assginRoleDto.getUserId());
        // 添加
        sysUserRoleMapper.insertUserRole(assginRoleDto);
    }
}
